/*
 * intQueue.java
 *
 * Created on 13 de febrero de 2007, 09:20 AM
 */

package shortestPath;


/**
 *
 * @author tavobula
 */
class intQueue {
    private int[] q; private int N, head, tail;
    
    intQueue(int maxN) {
        q = new int[maxN + 1];
        N = maxN + 1; head = N; tail = 0; 
    }
    
    boolean empty() {
        return (head % N == tail);
    }
    
    void put(int item) {
        q[tail++] = item; tail = tail % N; 
    }
    
    int get() {
        head = head % N; return q[head++]; 
    }
    
}